Skip to content

Conversation

yCodeTech
Copy link
Contributor

@yCodeTech yCodeTech commented Aug 27, 2025

  • Added the cumulative exit codes as documented in the interim proposal. This ensures a complete exit code documentation where users and devs can easily read exactly what the cumulative exit codes are.

  • Added another description to the 0 exit code to describe when issues are fixed with no issues remaining, because "clean code base" could just be interpreted as no issues at all.

Description

Related issues/external references

PHPCSStandards/PHP_CodeSniffer#184 (comment)

PR checklist

  • I have checked there is no other PR open for the same change.
  • I have read the Contribution Guidelines.
  • I grant the project the right to include my changes under the BSD-3-Clause license (and I have the right to grant these rights).
  • I have verified that my changes comply with the projects coding standards.
  • [When adding a new Wiki page] I have added the new page to the _Sidebar.md file.
  • [When adding/updating output examples] I have verified via the GitHub Actions artifact that the pre-processing handles the command correctly.

- Added the cumulative exit codes as documented in the interim proposal (PHPCSStandards/PHP_CodeSniffer#184 (comment)).

This ensures a complete exit code documentation where users and devs can easily read exactly what the cumulative exit codes are.

- Also added another description to the `0` exit code to describe when issues are fixed with no issues remaining, because "clean code base" could just be interpreted as no issues at all.
Copy link

github-actions bot commented Aug 27, 2025

=== This is an auto-generated comment ===

Thank you for your PR.
A dry-run has been executed on your PR, executing all markdown pre-processing for the wiki files.

Please review the resulting final markdown files via the created artifact.
This is especially important when adding new pages or updating auto-generated output blocks.

N.B.: the above link will automatically be updated when this PR is updated.

Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yCodeTech Hi Stu, thanks for this PR.

What with the cumulative exit codes table in this PR, I wonder if line 527 "Example ..." can be removed. What do you think ?

Oh and one small nitpick: to have more readable source code for the wiki, I tend to prefer tables to be properly aligned. The new table isn't.
If it helps, the https://table-magic.guntrip.co.uk/ website is a nice way to get the formatted table - paste the original table into the "Markdown" tab, uncheck and check again the "Table formatter" checkbox, copy & paste & done ;-)

@yCodeTech
Copy link
Contributor Author

yCodeTech commented Aug 27, 2025

@jrfnl Hi Juliette.

Yeah I wasn't sure whether to remove the "Example..." line or not. But because I added the 1+2 etc. into the descriptions (which I wasn't initially going to do), I guess the example line could be removed. Though it depends if the tables alone would be enough to describe the cumulative behaviour? I can remove the example on 527 if you think it's now redundant?

Oops my bad. While making sure my addition to the 0 code didn't mess up the table structure, I guess I forgot to do the same for the new table. I'll fix it now. That table-magic link is very good shout! I always had to do table formatting by hand. Not anymore!

@yCodeTech
Copy link
Contributor Author

Could potentially add an extra line to the introduction of the exit codes to describe the cumulative behaviour. Perhaps something like:

"...exit codes are cumulative, meaning some situations can be added on top of one another and will increase the exit code. The cumulative codes are composed..."

What do you think?

@jrfnl
Copy link
Member

jrfnl commented Aug 27, 2025

Yeah I wasn't sure whether to remove the "Example..." line or not. But because I added the 1+2 etc. into the descriptions (which I wasn't initially going to do), I guess the example line could be removed. Though it depends if the tables alone would be enough to describe the cumulative behaviour? I can remove the example on 527 if you think it's now redundant?

Could potentially add an extra line to the introduction of the exit codes to describe the cumulative behaviour. Perhaps something like:

"...exit codes are cumulative, meaning some situations can be added on top of one another and will increase the exit code. The cumulative codes are composed..."

@yCodeTech Looking at your responses and looking at the page again - how about instead of changing the intro line, we combine the "table header" line (for the new table) with the example line to say something along the lines of what you are hinting at with the text sample above ? Would that work ?

@yCodeTech
Copy link
Contributor Author

yCodeTech commented Aug 28, 2025

@jrfnl Ok so if I'm understanding your comment correctly, instead of having the "Example..." on line 527 and the "Cumulative exit codes:" on 529, we'd have a something like what I wrote above. If that's the case, it would work and the new line 527 could read:

"The exit codes in some situations can be combined, resulting in a new exit code. These cumulative exit codes are as follows:"

We could also change the cumulative table slightly to add a new column for the exit codes that are added together instead of having them in brackets in the description?

@jrfnl
Copy link
Member

jrfnl commented Aug 28, 2025

@yCodeTech Sounds good to me!

- Added new column to the cumulative exit codes table to define the codes that were combined, instead of defining them in brackets in the descriptions.

- Removed the now redundant cumulative exit code example.

- Changed the cumulative table header to describe the cumulative behaviour.
@yCodeTech
Copy link
Contributor Author

@jrfnl I've committed the changes. But regarding the new column, I'm not entirely sure what the best column title should be.

Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yCodeTech I think it's clear as it is now. And we can always iterate on this change again later.

Thanks for contributing!

@jrfnl jrfnl merged commit a0ee443 into PHPCSStandards:main Aug 28, 2025
8 checks passed
@yCodeTech yCodeTech deleted the wiki/phpcs-4.0/Advanced-Usage/add-cumulative-exit-codes branch August 28, 2025 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants